
{template 'common/header'}
<ul class="nav nav-tabs">
	<li><a href="{php echo $this->createWebUrl('repair', array('op' => 'list'))}">服务管理</a></li>
	<li class="active"><a href="{php echo $this->createWebUrl('repair', array('op'=>'category'));}">服务分类</a></li>
</ul>

<div class="main">
<div style="margin:0;" class="alert alert-info"><i class="icon-warning-sign"></i></div>
	<form class="form-horizontal form" action="" method="post" onsubmit="return formcheck(this)">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th  style="width:180px">分类名称</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody id="status-items">
			{loop $list $item}
				<tr>
					<td><input class="form-control" name="names[]" type="text" value="{$item['name']}">
					<input name="ids[]" type="hidden" value="{$item['id']}"></td>
					<td><a onclick="if (confirm('删除操作不可恢复，确认吗？')){ $(this).parent().parent().next().remove(); return true;} else {return false;}" href="{php echo $this->createWebUrl('repair', array('op' => 'del', 'id' => $item['id']))}" class="btn btn-small" title="删除"><i class="fa fa-times"></i>删除</a></td>
				</tr>
			{/loop}
			</tbody>
			<tr>
				<td colspan="2">
					<a href="javascript:;" onclick="addStatusItem()" class="btn btn-default btn-sm"><i class="icon-plus-sign-alt"></i> 添加新分类</a>
				</td>
			</tr>
		</table>
		<table class="tb">
			<tr>
				<td colspan="6">
					<button type="submit" class="btn btn-primary span3" name="submit" value="提交">提交</button>
					<input type="hidden" name="token" value="{$_W['token']}" />
				</td>
			</tr>
		</table>
	</form>
</div>
<script type="text/javascript">

	function addStatusItem() {
		var html = '' +
				'<tr>' +
					'<td><input class="form-control" name="names[]" title="服务分类" placeholder="分类名称" type="text" value=""/><input name="ids[]" type="hidden" value=""/></td>' +
			
					'<td><a href="javascript:;" onclick="$(this).parent().parent().remove();" class="btn btn-small" title="删除此条目"><i class="fa fa-times"></i>删除</a></td>' +
				'</tr>';
		$('#status-items').append(html);
	}

</script>

{template 'common/footer'}